
function validateReassignTask() {
 
	error="";

    o_order_id = trim(document.mainform.o_order_id.value);
    o_due_date = trim(document.mainform.o_due_date.value);
    oi_item_id = trim(document.mainform.oi_item_id.value);
    
    t_date_assigned = trim(document.mainform.t_date_assigned.value);
    t_employee_id = trim(document.mainform.t_employee_id.value);
    t_hours_of_work = trim(document.mainform.t_hours_of_work.value);

    orig_date_assigned = trim(document.mainform.orig_date_assigned.value);
    orig_employee_id = trim(document.mainform.orig_employee_id.value);
    orig_hours_of_work = trim(document.mainform.orig_hours_of_work.value);
	
	if (t_date_assigned == orig_date_assigned &&
	t_employee_id == orig_employee_id &&
	t_hours_of_work == orig_hours_of_work) {
		error = "&nbsp;&bull;There's been no change.<br/>";
	}
	else {
		if (t_employee_id == "") {
			error = "&nbsp;&bull;Employee ID must be given.<br/>";
		}
		else {
			var employeeRegExp = new RegExp("^[0-9]+$");
			if (!employeeRegExp.test(t_employee_id)) {
				error = "&nbsp;&bull;Employee ID should be a number.<br/>";
			}
		}
		
		if (t_date_assigned == "") {
			error = "&nbsp;&bull;Task must be assigned to a date.<br/>";
		}
		else {
			if (t_date_assigned >= o_due_date) {
				error = "&nbsp;&bull;Item wouldn't be ready in time for shipment.<br/>";
			}
			else {
				today = new Date();
				year = today.getFullYear();
				month = today.getMonth();
				month = parseInt(month) + 1;
				if (month <= 9) 
					month = "0" + month;
				day = today.getDate();
				if (day <= "9") 
					day = "0" + day;
				todayStr = year + "-" + month + "-" + day;
				
				if (t_date_assigned < todayStr) {
					error = "&nbsp;&bull; Date given is in the past. <br/>";
				}
				
			}
		}
		
		if (t_hours_of_work == "") {
			error = "&nbsp;&bull;Hours should be given.<br/>";
		}
		else {
			var hoursRegExp = new RegExp("^[1-8]+$");
			if (!hoursRegExp.test(t_hours_of_work)) {
				error = "&nbsp;&bull;Hours should be between 1 and 8.<br/>";
			}
		}
	}
	return decideOnSubmit(error);
 
}
